package com.sakura.hk.sakura.springboot.plugin.model;

import javax.tools.SimpleJavaFileObject;
import java.io.IOException;
import java.net.URI;

/**
 *  存储源文件
 * @Author: 贺坤
 * @Date: 2021/7/15 14:07
 */
public class StringObject extends SimpleJavaFileObject {

    private String content;

    public StringObject(URI uri, Kind kind, String content) {
        super(uri, kind);
        this.content = content;
    }
    /**
     * 获取字符串内容
     *
     * @param ignoreEncodingErrors  是否忽略编码错误(没使用改参数)
     * @return 返回文件的字符串编码
     * @throws IOException IO 异常
     */
    @Override
    public CharSequence getCharContent(boolean ignoreEncodingErrors) throws IOException {
        return this.content;
    }
}